package com.pet.server.po;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;

/**
 * SysLogger entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_logger")
public class SysLogger implements java.io.Serializable {

	// Fields
	private Integer id;
	private Integer longId;
	private String businessCode;
	private String operateName;
	private String userName;
	private Integer createUser;
	private String operateDesc;
	private Date createTime;

	// Constructors

	/** default constructor */
	public SysLogger() {
	}

	/** full constructor */
	public SysLogger(Integer longId, String businessCode, String operateName,
			Integer createUser, String operateDesc, Timestamp createTime) {
		this.longId = longId;
		this.businessCode = businessCode;
		this.operateName = operateName;
		this.createUser = createUser;
		this.operateDesc = operateDesc;
		this.createTime = createTime;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "long_id")
	public Integer getLongId() {
		return this.longId;
	}

	public void setLongId(Integer longId) {
		this.longId = longId;
	}

	@Column(name = "business_code", length = 20)
	public String getBusinessCode() {
		return this.businessCode;
	}

	public void setBusinessCode(String businessCode) {
		this.businessCode = businessCode;
	}

	@Column(name = "operate_name", length = 32)
	public String getOperateName() {
		return this.operateName;
	}

	public void setOperateName(String operateName) {
		this.operateName = operateName;
	}

	@Column(name = "create_user")
	public Integer getCreateUser() {
		return this.createUser;
	}

	public void setCreateUser(Integer createUser) {
		this.createUser = createUser;
	}

	@Column(name = "operate_desc", length = 800)
	public String getOperateDesc() {
		return this.operateDesc;
	}

	public void setOperateDesc(String operateDesc) {
		this.operateDesc = operateDesc;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", length = 0)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Formula("(SELECT u.user_name FROM sys_user u WHERE u.id=create_user)")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

}